Dashboard Temp Share Shortlinks Frames API

HTMLify

app.js
Views: 13 | Author: huxn-webdev
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
let indicator = document.querySelector(".scroll-indicator .progress");
let scrollHeight =
  document.documentElement.scrollHeight - document.documentElement.clientHeight;

window.addEventListener("scroll", scroll);

function scroll() {
  let scrollTop = document.documentElement.scrollTop;
  let scrolled = (scrollTop / scrollHeight) * 100;
  indicator.style.width = `${scrolled}%`;
}